package com.future.common.listener.nettysocketio;

import com.corundumstudio.socketio.SocketIOClient;
import com.future.model.SocketClient;
import com.jfinal.aop.Inject;

public class DisconnectListener implements com.corundumstudio.socketio.listener.DisconnectListener {
	@Inject
	private SocketClient socketClient;
	/**
	 * 断开连接删除该条记录
	 */
	@Override
	public void onDisconnect(SocketIOClient client) {
		String sessionId = client.getSessionId().toString();
		socketClient.deleteById(sessionId);
	}

}
